package com.gzsxy.model;

import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * @author xiaolong
 * @version 1.0
 * @description: security用户权限模型
 * @date 2021/11/3 13:52
 */
@Getter
@Setter
public class CustomUser extends User implements Serializable {


    private static final long serialVersionUID = 3686140315548457080L;
    private String id;
    private String userName;
    private String realName;
    private String password;

    private Date createTime;
    private Date lastLoginTime;


    private Boolean Deleted;

    //存放当前用户的权限标识
    private List<GrantedAuthority> authorities = new ArrayList<>();


  public CustomUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
    super(username, password,true,true,true,true, authorities);
  }

  public CustomUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
    super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
  }





}
